clear all
load ParEst_eh0_time0_Mex_girls ParEst_eh0_time0_Mex_girls
load trans_time1_eh0_comp1.out
Chute = ParEst_eh0_time0_Mex_girls; 
HandleLo = @Principal_A2_n_1;

Dij=trans_time1_eh0_comp1(1,:)'; % Read transition moments

Dnf_2	 =	Dij(9);
Dni_2	 =	Dij(10);
Dfn_2	 =	Dij(11);
Dff_2	 =	0;
Dfi_2	 =	Dij(12);
Din_2	 =	Dij(13);
Dii_2	 =	0;
Dif_2  =	Dij(14);

Lower =[Dfn_2,Din_2,Dnf_2,Dni_2,Dfi_2,Dif_2];
LoBo =zeros(1,13);
LoBo = [Lower, 0.1, 0.1, 0.1, 0.1, -10, -10, -10];
HiBo = [.81 .81 .81 .81 .81 .81 10 10 10 10 -4 5 0];
%options = optimoptions(@simulannealbnd, ...
 %                    'PlotFcn',{@saplotbestf,@saplottemperature,@saplotf,@saplotbestx,@saplotx},...
  %                    'FunctionTolerance',800,'ReannealInterval',2, ...
   %                  'InitialTemperature', 2*10^4*[1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 10 10 10 10 10 60], ...
    %                 'TemperatureFcn', @temperaturefast, 'MaxStallIterations', 4000);
                 options = saoptimset( ...
                     'TolFun',5000,'ReannealInterval',6, ...
                     'InitialTemperature', 10^2*[1 1 1 1 1 1 10 10 10 10 6 5 10], ...
                     'TemperatureFcn', @temperaturefast, 'TimeLimit', 1.5*86400); % default 10*
[x,fval,exitflag,output]  = simulannealbnd(HandleLo, Chute, LoBo, HiBo, options)
ParEst_eh0_time0_Mex_girls = x;
save ParEst_eh0_time0_Mex_girls ParEst_eh0_time0_Mex_girls
